projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4fa0dde
)
tools/xen-mfndump: Avoid using -ERROR as an upper loop bound
author
Andrew Cooper
<andrew.cooper3@citrix.com>
Mon, 25 Nov 2013 11:05:51 +0000
(11:05 +0000)
committer
Ian Jackson
<Ian.Jackson@eu.citrix.com>
Mon, 25 Nov 2013 12:16:11 +0000
(12:16 +0000)
Coverity ID:
1090375
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/misc/xen-mfndump.c
patch
|
blob
|
history
diff --git
a/tools/misc/xen-mfndump.c
b/tools/misc/xen-mfndump.c
index 88cfafa44e1acb28510b9d301b9bab26b893da91..dea9fa9e0c867c1b475f4565b2fb0a70a664859f 100644
(file)
--- a/
tools/misc/xen-mfndump.c
+++ b/
tools/misc/xen-mfndump.c
@@
-30,7
+30,8
@@
int help_func(int argc, char *argv[])
int dump_m2p_func(int argc, char *argv[])
{
- unsigned long i, max_mfn;
+ unsigned long i;
+ long max_mfn;
xen_pfn_t *m2p_table;
if ( argc > 0 )
@@
-41,6
+42,12
@@
int dump_m2p_func(int argc, char *argv[])
/* Map M2P and obtain gpfn */
max_mfn = xc_maximum_ram_page(xch);
+ if ( max_mfn < 0 )
+ {
+ ERROR("Failed to get the maximum mfn");
+ return -1;
+ }
+
if ( !(m2p_table = xc_map_m2p(xch, max_mfn, PROT_READ, NULL)) )
{
ERROR("Failed to map live M2P table");